There are two steps to performing BBM, which are implemented in the
BayesBrainMap R package: (1) prior estimation and (2) model fitting
(Figure 1).
Figure 1: Overview of Bayesian Brain Mapping.
| Global Signal Regression | Group ICA | Parcellation | ||
|---|---|---|---|---|
| 15 HCP ICs | 25 HCP ICs | 50 HCP ICs | Yeo 17 | |
| With GSR | ✔ | ✔ | ✔ | ✔ |
| Without GSR | ✔ | ✔ | ✔ | ✔ |
Templates used for Bayesian brain mapping.
Setup
To reproduce this workflow, first follow the setup process outlined in Appendix A.
Filter Subjects by Sufficient fMRI Scan Duration
See Appendix B.1 and script: 1_fd_time_filtering.R
Filter Unrelated Subjects
See Appendix B.2 and script: 2_unrelated_filtering.R
Balance sex within age groups
See Appendix B.3 and script: 3_balance_age_sex.R
The resulting subject list (valid_combined_subjects_balanced.rds) is used throughout the rest of the analysis.
estimate_prior()In this step, we estimate group-level statistical priors using the estimate_prior() function from the BayesBrainMap package.
The encoding parameter is set to combined, LR, and RL to use the final lists of subjects saved in Step 3.3 (valid_combined_subjects_balanced.rds, valid__LR_subjects_balanced.rds, and valid_RL_subjects_balanced.rds). The combined list includes individuals who passed motion filtering in both LR and RL directions for both sessions, were unrelated, and were sex-balanced within age groups. The LR and RL lists include subjects who met these criteria independently for each direction.
If encoding is combined, we include only REST1 sessions from both phase-encoding directions:
rfMRI_REST1_LR_Atlas_MSMAll_hp2000_clean.dtseries.nii
rfMRI_REST1_RL_Atlas_MSMAll_hp2000_clean.dtseries.nii
If encoding is LR or RL, we use both REST1 and REST2 sessions from the specified direction:
For LR:
rfMRI_REST1_LR_Atlas_MSMAll_hp2000_clean.dtseries.nii
rfMRI_REST2_LR_Atlas_MSMAll_hp2000_clean.dtseries.nii
For RL:
rfMRI_REST1_RL_Atlas_MSMAll_hp2000_clean.dtseries.nii
rfMRI_REST2_RL_Atlas_MSMAll_hp2000_clean.dtseries.nii
To standardize scan duration and improve data quality, we apply both initial volume dropping and temporal truncation using parameters handled directly by the estimate_prior() function from the BayesBrainMap package.
Specifically:
drop_first = 15 removes the first 15 volumes from each scan to eliminate early signal instability and motion artifacts.
scrub defines volumes to exclude after a target duration. In our case, we truncate data to the first 10 minutes (600 seconds), excluding any volumes beyond that point.
See Appendix C for more details.
We consider three types of group-level parcellations for estimating priors:
HCP GICA parcellation (GICA15.dscalar.nii, etc.), available in the data_OSF/inputs folder. These files were downloaded from the HCP website, specifically from the CIFTI Subject-specific ICA Parcellations dataset for 15-, 25-, and 50-dimensionalities.
Yeo17 parcellation (Yeo et al. 2011). For details on how this parcellation was processed and simplified for use, see Appendix D.
Midnight Scan Club (MSC) parcellation (Gordon et al. 2017).For details on how the MSC parcellation was processed for use in this project, see [TODO].
Each of these parcellations was used to estimate priors with and without global signal regression (GSR), resulting in eight total priors saved as .rds files. See Table 1 [TODO link] for a summary of the parcellations and GSR combinations.
# This script estimates and saves functional connectivity priors
# for both spatial topography and connectivity.
# It supports both GICA-based (15/25/50 ICs) and Yeo17 parcellations,
# with or without global signal regression (GSR).
# For priors using the "combined" subject list, it loads REST1-LR and REST1-RL
# scans for each subject,
# drops the first 15 volumes, and truncates each scan to approximately 10 minutes.
# Outputs:
# - Priors `.rds` file saved in `dir_results`
source("5_estimate_prior.R")
Running estimate_prior() on the full "combined" subject list (~350 subjects) takes approximately 27 hours and uses 135 GB of memory.
For an example of how to run estimate_prior() and all relevant parameters, see Appendix E.
In this section, we visualize both the parcellation maps and the priors outputs (mean and variance) for each parcellation scheme used in the study: Yeo17, 15 IC, 25 IC, and 50 IC using the combined list of subjects.
We also visualize their corresponding functional connectivity (FC) priors.
Script: 8_visualization_Yeo17parcellations.R
This script creates one PNG image per parcel (17 in total), where only the selected parcel is colored and all others are white. The parcellation used is Yeo17, created in Appendix D.
Images are saved in data-OSF/outputs/parcellations_plots/Yeo17.
Script: 9_visualization_GICAparcellations.R
This script loops over all independent components for each parcellation dimensionality (nIC = 15, 25, 50) and generates two images per component:
A cortical surface map (e.g., GICA15_IC1.png)
A subcortical view (e.g., GICA15_IC1_sub.png)
The resulting images are saved in the following folders:
data_OSF/outputs/parcellations_plots/GICA15/
data_OSF/outputs/parcellations_plots/GICA25
data_OSF/outputs/parcellations_plots/GICA50
Each pair of files corresponds to a specific ICA component and captures its spatial map across brain regions.
Script: 6_visualization_prior.R
This script loads each estimated prior file from priors_rds/ and plots both the mean and standard deviation components for all independent components (ICs).
All images are organized into folders by number of ICs, GSR setting, and corresponding list of subjects used, e.g.:
data_OSF/priors_plots/GICA15/combined/GSR/
data_OSF/priors_plots/GICA15/combined/noGSR/
data_OSF/priors_plots/GICA25/LR/noGSR/
data_OSF/priors_plots/Yeo17/RL/GSR/
...
In this section, we present a comparative visual summary of the estimated group-level priors.
For each parcellation type Yeo17, 15 ICs, 25 ICs, and 50 IC, we display:
First and Last Parcellation Map
First and Last Component Mean
First and Last Component Standard Deviation
These summaries are shown in a 2-column grid layout per parcellation to highlight spatial structure and variability.
All images were generated using the scripts:
8_visualization_Yeo17parcellations.R
9_visualization_GICAparcellations.R
6_visualization_prior.R
| IC | Component | Mean | Standard Deviation |
|---|---|---|---|
| IC1 |
|
|
|
| IC15 |
|
|
|
| IC | Component | Mean | Standard Deviation |
|---|---|---|---|
| IC1 |
|
|
|
| IC25 |
|
|
|
| IC | Component | Mean | Standard Deviation |
|---|---|---|---|
| IC1 |
|
|
|
| IC50 |
|
|
|
| Network | Component | Mean | Standard Deviation |
|---|---|---|---|
| DefaultA |
|
|
|
| DorsAttnA |
|
|
|
TODO: For the paper instead of here?
| Network | Component | Mean | Standard Deviation |
|---|---|---|---|
| Yeo17 DefaultA |
|
|
|
| GICA15 IC 2 |
|
|
|
| GICA25 IC 2 |
|
|
|
| GICA50 IC 12 |
|
|
|
| MSC Default |
|
|